﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QApplication>
#include <QPair>
#include <QAction>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>

class Entity;
class Link;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void addEntity();
    void addLink();
    void del();
    void copy();
    void paste();
    void updateActions();

private:
    typedef QPair<Entity*, Entity*> EntityPair;

    void initActions();
    void initToolBars();
    void setZValue(int z);
    void setupEntity(Entity *pEntity);
    Entity *selectedEntity() const;
    Link *selectedLink() const;
    EntityPair selectedEntityPair() const;

private:
    Ui::MainWindow *ui;

    QGraphicsScene *m_pScene;
    QGraphicsView *m_pView;

    int seqNumber;
};

#endif // MAINWINDOW_H
